home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsIStreamLoader.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  8KB  |  224 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIStreamLoader.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIStreamLoader_h__
  6. #define __gen_nsIStreamLoader_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. #ifndef __gen_nsIChannel_h__
  14. #include "nsIChannel.h"
  15. #endif
  16.  
  17. /* For IDL files that don't want to include root IDL files. */
  18. #ifndef NS_NO_VTABLE
  19. #define NS_NO_VTABLE
  20. #endif
  21. class nsIRequest; /* forward declaration */
  22.  
  23. class nsIURI; /* forward declaration */
  24.  
  25. class nsILoadGroup; /* forward declaration */
  26.  
  27. class nsIStreamLoader; /* forward declaration */
  28.  
  29. class nsIInterfaceRequestor; /* forward declaration */
  30.  
  31.  
  32. /* starting interface:    nsIStreamLoaderObserver */
  33. #define NS_ISTREAMLOADEROBSERVER_IID_STR "359f7990-d4e9-11d3-a1a5-0050041caf44"
  34.  
  35. #define NS_ISTREAMLOADEROBSERVER_IID \
  36.   {0x359f7990, 0xd4e9, 0x11d3, \
  37.     { 0xa1, 0xa5, 0x00, 0x50, 0x04, 0x1c, 0xaf, 0x44 }}
  38.  
  39. class NS_NO_VTABLE nsIStreamLoaderObserver : public nsISupports {
  40.  public: 
  41.  
  42.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISTREAMLOADEROBSERVER_IID)
  43.  
  44.   /* void onStreamComplete (in nsIStreamLoader loader, in nsISupports ctxt, in nsresult status, in unsigned long resultLength, [array, size_is (resultLength), const] in octet result); */
  45.   NS_IMETHOD OnStreamComplete(nsIStreamLoader *loader, nsISupports *ctxt, nsresult status, PRUint32 resultLength, const PRUint8 *result) = 0;
  46.  
  47. };
  48.  
  49. /* Use this macro when declaring classes that implement this interface. */
  50. #define NS_DECL_NSISTREAMLOADEROBSERVER \
  51.   NS_IMETHOD OnStreamComplete(nsIStreamLoader *loader, nsISupports *ctxt, nsresult status, PRUint32 resultLength, const PRUint8 *result); 
  52.  
  53. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  54. #define NS_FORWARD_NSISTREAMLOADEROBSERVER(_to) \
  55.   NS_IMETHOD OnStreamComplete(nsIStreamLoader *loader, nsISupports *ctxt, nsresult status, PRUint32 resultLength, const PRUint8 *result) { return _to OnStreamComplete(loader, ctxt, status, resultLength, result); } 
  56.  
  57. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  58. #define NS_FORWARD_SAFE_NSISTREAMLOADEROBSERVER(_to) \
  59.   NS_IMETHOD OnStreamComplete(nsIStreamLoader *loader, nsISupports *ctxt, nsresult status, PRUint32 resultLength, const PRUint8 *result) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStreamComplete(loader, ctxt, status, resultLength, result); } 
  60.  
  61. #if 0
  62. /* Use the code below as a template for the implementation class for this interface. */
  63.  
  64. /* Header file */
  65. class nsStreamLoaderObserver : public nsIStreamLoaderObserver
  66. {
  67. public:
  68.   NS_DECL_ISUPPORTS
  69.   NS_DECL_NSISTREAMLOADEROBSERVER
  70.  
  71.   nsStreamLoaderObserver();
  72.  
  73. private:
  74.   ~nsStreamLoaderObserver();
  75.  
  76. protected:
  77.   /* additional members */
  78. };
  79.  
  80. /* Implementation file */
  81. NS_IMPL_ISUPPORTS1(nsStreamLoaderObserver, nsIStreamLoaderObserver)
  82.  
  83. nsStreamLoaderObserver::nsStreamLoaderObserver()
  84. {
  85.   /* member initializers and constructor code */
  86. }
  87.  
  88. nsStreamLoaderObserver::~nsStreamLoaderObserver()
  89. {
  90.   /* destructor code */
  91. }
  92.  
  93. /* void onStreamComplete (in nsIStreamLoader loader, in nsISupports ctxt, in nsresult status, in unsigned long resultLength, [array, size_is (resultLength), const] in octet result); */
  94. NS_IMETHODIMP nsStreamLoaderObserver::OnStreamComplete(nsIStreamLoader *loader, nsISupports *ctxt, nsresult status, PRUint32 resultLength, const PRUint8 *result)
  95. {
  96.     return NS_ERROR_NOT_IMPLEMENTED;
  97. }
  98.  
  99. /* End of implementation class template. */
  100. #endif
  101.  
  102.  
  103. /* starting interface:    nsIStreamLoader */
  104. #define NS_ISTREAMLOADER_IID_STR "31d37360-8e5a-11d3-93ad-00104ba0fd40"
  105.  
  106. #define NS_ISTREAMLOADER_IID \
  107.   {0x31d37360, 0x8e5a, 0x11d3, \
  108.     { 0x93, 0xad, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40 }}
  109.  
  110. class NS_NO_VTABLE nsIStreamLoader : public nsISupports {
  111.  public: 
  112.  
  113.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISTREAMLOADER_IID)
  114.  
  115.   /**
  116.  * Asynchronously loads a channel into a memory buffer.
  117.  *
  118.  * XXX define behaviour for sizes >4 GB
  119.  */
  120. /**
  121.      * Initialize this stream loader, and start loading the data.
  122.      *
  123.      * @param aChannel
  124.      *        A Channel to load data from. This must not be asyncOpen'd yet!
  125.      * @param aObserver
  126.      *        An observer that will be notified when the data is complete.
  127.      * @param aContext
  128.      *        May be null. Will be passed to the observer.
  129.      *
  130.      * @note Failure to open the channel will be indicated by an async callback
  131.      *       to the observer.
  132.      */
  133.   /* void init (in nsIChannel aChannel, in nsIStreamLoaderObserver aObserver, in nsISupports aContext); */
  134.   NS_IMETHOD Init(nsIChannel *aChannel, nsIStreamLoaderObserver *aObserver, nsISupports *aContext) = 0;
  135.  
  136.   /**
  137.      * Gets the number of bytes read so far.
  138.      */
  139.   /* readonly attribute unsigned long numBytesRead; */
  140.   NS_IMETHOD GetNumBytesRead(PRUint32 *aNumBytesRead) = 0;
  141.  
  142.   /**
  143.      * Gets the request that loaded this file.
  144.      * null after the request has finished loading.
  145.      */
  146.   /* readonly attribute nsIRequest request; */
  147.   NS_IMETHOD GetRequest(nsIRequest * *aRequest) = 0;
  148.  
  149. };
  150.  
  151. /* Use this macro when declaring classes that implement this interface. */
  152. #define NS_DECL_NSISTREAMLOADER \
  153.   NS_IMETHOD Init(nsIChannel *aChannel, nsIStreamLoaderObserver *aObserver, nsISupports *aContext); \
  154.   NS_IMETHOD GetNumBytesRead(PRUint32 *aNumBytesRead); \
  155.   NS_IMETHOD GetRequest(nsIRequest * *aRequest); 
  156.  
  157. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  158. #define NS_FORWARD_NSISTREAMLOADER(_to) \
  159.   NS_IMETHOD Init(nsIChannel *aChannel, nsIStreamLoaderObserver *aObserver, nsISupports *aContext) { return _to Init(aChannel, aObserver, aContext); } \
  160.   NS_IMETHOD GetNumBytesRead(PRUint32 *aNumBytesRead) { return _to GetNumBytesRead(aNumBytesRead); } \
  161.   NS_IMETHOD GetRequest(nsIRequest * *aRequest) { return _to GetRequest(aRequest); } 
  162.  
  163. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  164. #define NS_FORWARD_SAFE_NSISTREAMLOADER(_to) \
  165.   NS_IMETHOD Init(nsIChannel *aChannel, nsIStreamLoaderObserver *aObserver, nsISupports *aContext) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aChannel, aObserver, aContext); } \
  166.   NS_IMETHOD GetNumBytesRead(PRUint32 *aNumBytesRead) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNumBytesRead(aNumBytesRead); } \
  167.   NS_IMETHOD GetRequest(nsIRequest * *aRequest) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRequest(aRequest); } 
  168.  
  169. #if 0
  170. /* Use the code below as a template for the implementation class for this interface. */
  171.  
  172. /* Header file */
  173. class nsStreamLoader : public nsIStreamLoader
  174. {
  175. public:
  176.   NS_DECL_ISUPPORTS
  177.   NS_DECL_NSISTREAMLOADER
  178.  
  179.   nsStreamLoader();
  180.  
  181. private:
  182.   ~nsStreamLoader();
  183.  
  184. protected:
  185.   /* additional members */
  186. };
  187.  
  188. /* Implementation file */
  189. NS_IMPL_ISUPPORTS1(nsStreamLoader, nsIStreamLoader)
  190.  
  191. nsStreamLoader::nsStreamLoader()
  192. {
  193.   /* member initializers and constructor code */
  194. }
  195.  
  196. nsStreamLoader::~nsStreamLoader()
  197. {
  198.   /* destructor code */
  199. }
  200.  
  201. /* void init (in nsIChannel aChannel, in nsIStreamLoaderObserver aObserver, in nsISupports aContext); */
  202. NS_IMETHODIMP nsStreamLoader::Init(nsIChannel *aChannel, nsIStreamLoaderObserver *aObserver, nsISupports *aContext)
  203. {
  204.     return NS_ERROR_NOT_IMPLEMENTED;
  205. }
  206.  
  207. /* readonly attribute unsigned long numBytesRead; */
  208. NS_IMETHODIMP nsStreamLoader::GetNumBytesRead(PRUint32 *aNumBytesRead)
  209. {
  210.     return NS_ERROR_NOT_IMPLEMENTED;
  211. }
  212.  
  213. /* readonly attribute nsIRequest request; */
  214. NS_IMETHODIMP nsStreamLoader::GetRequest(nsIRequest * *aRequest)
  215. {
  216.     return NS_ERROR_NOT_IMPLEMENTED;
  217. }
  218.  
  219. /* End of implementation class template. */
  220. #endif
  221.  
  222.  
  223. #endif /* __gen_nsIStreamLoader_h__ */
  224.